package com.ansys.demo.service.impl;

import com.ansys.demo.bean.IdSum;
import com.ansys.demo.mapper.IdSumMapper;
import com.ansys.demo.service.IdSumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: panghai
 * @Date: 2022/04/06/18:49
 * @Description: 答题情况类
 */
@Service
public class IdSumServiceImpl implements IdSumService {

    @Autowired
    private IdSumMapper idSumMapper;


    /**
     * 获取答对题目数的数量
     * @return 获取答对题目数的数量
     */
    @Override
    public List<IdSum> getIdSumList() {
        return idSumMapper.getIdSum();
    }

    /**
     * 上传答题情况（上传做对题目数即可）
     * @param num 做对题目数
     * @return 上传结果
     */
    @Override
    public int uploadTopic(int num) {
        return idSumMapper.uploadTopic(num);
    }
}
